package com.bclz.utils;

import java.io.IOException;
import java.util.Properties;

public class LoadProperties {

    private volatile static Properties prop = null;

    private LoadProperties() {


    }

    public static Properties loadConfig() {


        if(prop==null) {

            synchronized (LoadProperties.class) {
                if(prop==null) {
                    prop=new Properties();
                    try {
                        prop.load(LoadProperties.class.getClassLoader().getResourceAsStream("config.properties"));
                    } catch (IOException e) {
                        // TODO Auto-generated catch block
                        System.out.println("属性文件载入异常:"+e.getMessage());
                    }
                }
            }

        }
        return prop;

    }


}
